package com.android.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.android.apis.entity.Video;
import com.android.service.VideoService;
import com.google.gson.Gson;

@Controller
public class VideoController {
	@Autowired
	public VideoService videoService;
	@ResponseBody
	@RequestMapping(value="/getVideo",produces = "text/json;charset=UTF-8",method=RequestMethod.POST)
	public String selectByTitle(HttpServletRequest request) {
		String title = request.getParameter("type");
		List<Video> list = videoService.selectByTitle(title);
		Gson gson=new Gson();
		String gson1=gson.toJson(list);
		return gson1;
	}

}
